﻿using System;

namespace Tables
{
    class Link : IDisposable
    {
        public Link()
        {
            _pNext = new Link();
            _id = 0;
        }
        public Link(Link pNext, int id)
        {
            _pNext = pNext;
            _id = id;
        }
        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }
        protected virtual void Dispose(bool disposing)
        {
            if (!_disposed)
            {
                if (disposing)
                {
                    //disposed managed resource

                }
                // release unmanaged resource
            }
            _disposed = true;

            // if available, call to base class
            // base.Dispose(disposing);
        }
        public Link Next()
        {
            return _pNext;
        }
        public int Id()
        {
            return _id;
        }


        private int _id;
        private Link _pNext;
        private bool _disposed = false;
    }
}
